<?php
	class AdsWidget extends CWidget
	{
		public function run()
		{
			$this->getads();
		}
		public function getads()
		{
			$criteria = new CDbCriteria;
			$criteria->condition = 'disabled=:status';
			$criteria->params = array(':status' => 1);
			$criteria->order = 'created_date DESC';
			$data = Ads::model()->findAll($criteria);
			$this->render('ads', compact('data'));
		}
	}
?>